<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Dashboard Template for Bootstrap</title>
    <!-- Bootstrap core CSS -->
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link th:href="@{/css/dashboard.css}" rel="stylesheet">
    <style type="text/css">
        /* Chart.js */

        @-webkit-keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        @keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        .chartjs-render-monitor {
            -webkit-animation: chartjs-render-animation 0.001s;
            animation: chartjs-render-animation 0.001s;
        }
    </style>
</head>

<body>
<div th:replace="~{common/commons::topbar}"></div>

<div class="container-fluid">
    <div class="row">
        <div th:replace="~{common/commons::sidebar(active='empList.html')}"></div>

        <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
            <h2>修改员工信息</h2>
            <form th:action="@{/updateEmp}" method="post" >
                <input name="id" type="hidden" class="form-control" th:value="${emp.id}">
                <div class="form-group">
                    <label>姓名</label>
                    <input name="employeename" type="text" class="form-control " th:value="${emp.employeename}" >
                </div>
                <div class="form-group">
                    <label>身份证号</label>
                    <input name="idcard" type="text" class="form-control " th:value="${emp.idcard}" >
                </div>
                <div class="form-group">
                    <label>性别</label><br/>
                    <div class="form-check form-check-inline">
                        <input class="form-check-input" type="radio" name="sex" value="1"
                               th:checked="${emp.sex==1}">
                        <label class="form-check-label">男</label>
                    </div>
                    <div class="form-check form-check-inline">
                        <input class="form-check-input" type="radio" name="sex" value="2"
                               th:checked="${emp.sex==2}">
                        <label class="form-check-label">女</label>
                    </div>
                </div>
                <div class="form-group">
                    <label>年龄</label>
                    <input name="age" type="text" class="form-control " th:value="${emp.age}" >
                </div>
                <div class="form-group">
                    <label>电话</label>
                    <input name="telephone" type="text" class="form-control " th:value="${emp.telephone}" >
                </div>
                <div class="form-group">
                    <label>地址</label>
                    <input name="address" type="text" class="form-control " th:value="${emp.address}" >
                </div>
                <div class="form-group">
                    <label>邮箱</label>
                    <input name="email" type="text" class="form-control" th:value="${emp.email}">
                </div>
                <div class="form-group">
                    <label>部门</label>
                    <!--提交的是部门的ID-->
                    <select class="form-control" name="departmentid">
                        <option th:selected="${dept.id == emp.departmentid}" th:each="dept:${departments}"
                                th:text="${dept.departmentname}" th:value="${dept.id}">1
                        </option>
                    </select>
                </div>
                <div class="form-group">
                    <label for="InputPosition">职位</label>
                    <input name="position" type="text" class="form-control" id="InputPosition" th:value="${emp.position}" required>
                </div>
                <div class="form-group">
                    <label>入职日期</label>
                    <input name="date" type="text"  class="form-control" id="dateFormat" autocomplete="off" th:value="${emp.date}" required>
                </div>
                <button type="submit" class="btn btn-primary">修改</button>
            </form>
        </main>
    </div>
</div>

<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" th:src="@{/js/jquery-3.2.1.slim.min.js}"></script>
<script type="text/javascript" th:src="@{/js/popper.min.js}"></script>
<script type="text/javascript" th:src="@{/js/bootstrap.min.js}"></script>
<!--		日期组件-->
<script type="text/javascript" th:src="@{/laydate/laydate.js}"></script>
<script>
    //执行一个laydate实例
    laydate.render({
        elem: '#dateFormat',
        trigger:'click'//指定元素
    });
</script>
</body>

</html>
